_endPanGesture(panGesture) {
const velocity = panGesture.get_velocity();
const v = this.orientation === Clutter.Orientation.HORIZONTAL
- ? -velocity.get_x()
- : -velocity.get_y();
+ ? this._getGestureDirFactor() * velocity.get_x()
+ : this._getGestureDirFactor() * velocity.get_y();
this._endGesture(v, this._distance, false);
}
this._endGesture(0, this._distance, false);
}
+ _getGestureDirFactor() {
+ if (this.orientation === Clutter.Orientation.HORIZONTAL &&
+ Clutter.get_default_text_direction() === Clutter.TextDirection.RTL)
+ return 1;
+
+ return -1;
+ }
+
/**
* Confirms a swipe. User has to call this in 'begin' signal handler,
* otherwise the swipe wouldn't start. If there's an animation running,